#include<algorithm>
#include<iostream>
#include<string>
#include<math.h>
using namespace std;
int main()
{
	int n;
	while (cin >> n)
	{

		int x[10010], y[10010];
		for (int i = 0; i < n; i++)
		{
			cin >> x[i] >> y[i];
		}
		sort(x, x + n);
		sort(y, y + n);
		int ans = 0;
		for (int i = 0; i < n; i++)
		{
			ans += abs(x[n / 2] - x[i]) + abs(y[n / 2] - y[i]);
		}
		cout << ans << endl;
	}
	return 0;
}